<template>
  <div class="hello">
    <h3>新增班级信息</h3>
    <p>
      <label for="studentName">班级名称</label><br/>
      <input type="text" id='studentName' v-model.lazy='classInfo.name'>
    </p>
    <div>
      <label for="">负责教师</label>
      <input type="checkbox" name="" id="">    
    </div>
    <p>
      <button @click='addClass()'>新增班级</button>
    </p>

  </div>
</template>

<script>
import api from '../../http/apis/apis.js'

export default {
  data(){
    return {
      classInfo:{
        name:'',
        teachers:['6278cfce83728fa897676d73','6278d0d71478dee58a519547']
      }
    }
  },
  methods:{
    async addClass(){
      const {data} = await api.classApi.addClass(this.classInfo);
      if (data.status) {
        alert(data.message);
      }else{
        alert(data.message);
      }
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
